<template>
  <el-dialog
      :title="dialogTitle"
      v-model="dialogVisible"
      width="70%"
      append-to-body
      modal-append-to-body
      v-loading="loading"
      @close="handleClose">
    <start-act-task-candidate-user ref="startActTaskCandidateUser"></start-act-task-candidate-user>
  </el-dialog>
</template>

<script>
import StartActTaskCandidateUser from "./taskCandidateUser.vue";

export default {
  name: "taskCandidateUserDialog",
  components: {StartActTaskCandidateUser},
  computed: {
    dialogTitle() {
      if (!this.taskModel || !this.taskModel.taskName) {
        return "加载中"
      }
      return `【${this.taskModel.taskName}】审批人`
    }
  },
  data() {
    return {
      loading: false,
      dialogVisible: false,
      taskModel: {},
    }
  },
  methods: {
    open(row) {
      this.taskModel = row;
      this.dialogVisible = true;
      this.$nextTick(() => {
        this.$refs.startActTaskCandidateUser.init(this.taskModel)
      })
    },
    handleClose() {
      this.dialogVisible = false;
      this.taskModel = {};
    },
  }

}
</script>

<style scoped>

</style>